<template>
  <div>
    <elm-page-tb>
      <template #top>
        <el-date-picker type="date" value-format="yyyy-MM-dd" size="mini" style="width:250px;" v-model="postData.date" clearable></el-date-picker>
        <right>
          <el-button-group>
            <el-button icon="el-icon-search" size="mini" @click="tablebinding()">查询</el-button>
            <elm-open-button url="daily_edit" title="新增"  width="800" height="50%">新增</elm-open-button>
            <elm-open-button url="daily_turn" title="选择"  width="800" height="80%">生成</elm-open-button>
          </el-button-group>
        </right>
      </template>
      <elm-table url="/business/my/business/GetDailyByUser" :post-data="postData">
        <el-table-column prop="pj_mc" label="项目名称" align="left" header-align="center"></el-table-column>
        <el-table-column prop="work" label="工作内容" align="left" header-align="center" ></el-table-column>
        <el-table-column prop="hour" label="工作时长" align="center"  width="80"></el-table-column>
        <el-table-column prop="is_complete" label="是否完成" align="center"  width="80">
          <template v-slot="scope">
            {{scope.row.is_complete?"是":"否"}}
          </template>
        </el-table-column>
        <el-table-column prop="create_date" label="创建日期" align="center" width="100" :formatter="formatDate"></el-table-column>
        <el-table-column prop="create_user_mc" label="提交人" align="center" width="100"></el-table-column>
        <el-table-column prop="remark" label="备注" align="left" header-align="center"></el-table-column>
        <el-table-column fixed="right" label="操作" width="120px" align="center">
          <template v-slot="scope">
            <elm-open-button url="daily_edit" title="编辑" width="800" height="50%" :data="{ model: scope.row }" type="text">编辑</elm-open-button>
            <elm-delete-button  type="text" size="mini" url="/business/my/business/DeleteDaily" :data="{ id: scope.row.id }">删除</elm-delete-button>
          </template>
        </el-table-column>
      </elm-table>
    </elm-page-tb>
  </div>

</template>

<script>
export default {
  extends: elmVueBase,
  data() {
    return {
      postData: { date: new Date().toISOString().split('T')[0]}
    }
  },
  created() {
  },
  methods: {
  }
}
</script>
